<template>
  <van-tabs v-model:active="active" line-height="0" ref="tabsRef">
    <van-tab v-for="index in 8" >
      <template #title>
        <div class="tab-item">
          自定义内容
        </div>
      </template>
      内容 {{ index }}
    </van-tab>
  </van-tabs>
  <div @click="clickBtn">测试btn</div>
  <p>名字：{{person.name}}</p>
  <p>年龄：{{person.age}}</p>
  <p>数字：{{teststore.num}}</p>
  <button @click="changeDate">修改数据</button>
</template>
<script setup>
     import { ref } from 'vue';
     import { testStore } from '../store';
     const active = ref(0);
     const tabsRef = ref();
     const teststore = testStore();
     const person = testStore().person;

     const clickBtn = () => {
       // tabsRef.value?.scrollTo(-1);
       tabsRef.value?.resize();
     }

     const changeDate = () => {
       teststore.changeNum();
     }
</script>
<style scoped lang="scss">

</style>
